import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    title: '网页的页签栏标题',
    home: Scaffold(
      // 顶部操作栏
      appBar: AppBar(
        title: Text('标题'),
        backgroundColor: Colors.pink,
      ),
      // 配出正文主题部分
      body: Main(),
    ),
  ));
}

class Main extends StatelessWidget {
  Main({Key? key}) : super(key: key);

  Map data = {
    "createTime": "2024-08-15 21:49:48",
    "orderState": 2,
    "image":
        "https://yanxuan-item.nosdn.127.net/a09de222ed32efa8ffe359b1d5780574.jpg",
    "name": "茶水分离杯耐热隔热玻璃杯",
    "totalNum": 2,
    "curPrice": 119.5,
    "totalMoney": 119.5,
    "attrsText": "规格:白色240ml"
  };

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(5),
      child: ListView(
        // ListView 会拉伸 子组件的宽度和高度, 与父组件项目
        scrollDirection: Axis.horizontal,
        children: [
          Container( child: Text('A'), color: Colors.amber, width: 100, ),
          Container( child: Text('B'), color: Colors.red, width: 100, ),
          Container( child: Text('C'), color: Colors.green, width: 100, ),
          Container( child: Text('D'), color: Colors.blue, width: 100, ),
          Container( child: Text('A'), color: Colors.amber, width: 100, ),
          Container( child: Text('B'), color: Colors.red, width: 100, ),
          Container( child: Text('C'), color: Colors.green, width: 100, ),
          Container( child: Text('D'), color: Colors.blue, width: 100, ),
          Container( child: Text('A'), color: Colors.amber, width: 100, ),
          Container( child: Text('B'), color: Colors.red, width: 100, ),
          Container( child: Text('C'), color: Colors.green, width: 100, ),
          Container( child: Text('D'), color: Colors.blue, width: 100, ),
        ],

      )
          

      
    );
  }
}
